<?php
/*
+--------------------------------------------------------------------------
|   AffiliStore 2
|   ========================================
|   Web: http://www.affilistore.com
|   Email: admin (at) affilistore (dot) com
|	License Type: AffiliStore 2 is NOT open source software and limitations apply 
|   Licence Info: Visit AffiliStore website and click on 'Licence'
+--------------------------------------------------------------------------
*/
if (eregi(".inc.php",$HTTP_SERVER_VARS['PHP_SELF']) || eregi(".inc.php",$_SERVER['PHP_SELF'])) {
	echo "<html>\r\n<head>\r\n<title>Forbidden 403</title>\r\n</head>\r\n<body><h3>Forbidden 403</h3>\r\nThe document you are requesting is forbidden.\r\n</body>\r\n</html>";
	exit;
}



// news listing
$getNews = mysql_query("SELECT * FROM affiliSt_news ORDER BY timestamp DESC,id DESC LIMIT 0, ".$pPerPage[3]."");
$newsItemsSummary = mysql_fetch_assoc($getNews);

$box_content = new XTemplate ("skins/".$configSkin['value']."/styleTemplates/news.tpl");

	if ($navOpt[7] == 1) {
	// html perma
	$box_content->assign("NEWSLINK",$installDir['value'].'news/home.html');
	} else {
	// php link
	$box_content->assign("NEWSLINK",$installDir['value'].'index.php?case=news&npag=home');
	}			
					
	do {
					if ($navOpt[7] == 1) {
					// html perma
					$box_content->assign("LINKDATA",$installDir['value'].'newsitem/'.$newsItemsSummary['id'].'/'.urltxt($newsItemsSummary['name']).'.html');
					} else {
					// php link
					$box_content->assign("LINKDATA",$installDir['value'].'index.php?case=newsitem&npag='.$newsItemsSummary['id']);
					}
					
					$box_content->assign("DATE",'<span style="color:#666666">('.date('d F Y', $newsItemsSummary['timestamp']).')</span>');
					$box_content->assign("DATA",$newsItemsSummary['name']);
					$box_content->assign("NEWSCONTENT",substr(strip_tags($newsItemsSummary['content']), 0, 150).'...');
					$box_content->parse("newsitems.li");
	
		} while ($newsItemsSummary = mysql_fetch_assoc($getNews));




$box_content->assign("DATA", "Latest News");

$box_content->assign("SKIN",$configSkin['value']);
$box_content->parse("newsitems");
$box_content = $box_content->text("newsitems");
?>